package com.cloud.pora.mrm.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.jboss.seam.annotations.Name;


/**
 * The persistent class for the meeting_room database table.
 * 
 */
@Name("meetingRoom")
@Entity
@Table(name="meeting_room")
public class MeetingRoom implements Serializable {
	private static final Long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="mr_id", unique=true, nullable=false)
	private Long mrId;

	@Column(name="insert_id", length=45)
	private String insertId;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="insert_time", nullable=false)
	private Date insertTime;

	@Column(name="mr_active", length=1)
	private Character mrActive;

	@Column(name="mr_addr", length=60)
	private String mrAddr;

	@Column(name="mr_memo", length=200)
	private String mrMemo;

	@Column(name="mr_name", length=60)
	private String mrName;

	@Column(name="mr_size")
	private Integer mrSize;

	@Column(name="update_id", length=45)
	private String updateId;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="update_time", nullable=false)
	private Date updateTime;

	@Column(name="mr_type", length=45)
	private String mrType;
	
	public String getMrType() {
		return mrType;
	}

	public void setMrType(String mrType) {
		this.mrType = mrType;
	}

	//bi-directional many-to-one association to MeetingRoomBooking
	@OneToMany(mappedBy="meetingRoom", cascade={CascadeType.ALL})
	private Set<MeetingRoomBooking> meetingRoomBookings;

	public MeetingRoom() {
	}

	public Long getMrId() {
		return this.mrId;
	}

	public void setMrId(Long mrId) {
		this.mrId = mrId;
	}

	public String getInsertId() {
		return this.insertId;
	}

	public void setInsertId(String insertId) {
		this.insertId = insertId;
	}

	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	public Character getMrActive() {
		return this.mrActive;
	}

	public void setMrActive(Character mrActive) {
		this.mrActive = mrActive;
	}

	public String getMrAddr() {
		return this.mrAddr;
	}

	public void setMrAddr(String mrAddr) {
		this.mrAddr = mrAddr;
	}

	public String getMrMemo() {
		return this.mrMemo;
	}

	public void setMrMemo(String mrMemo) {
		this.mrMemo = mrMemo;
	}

	public String getMrName() {
		return this.mrName;
	}

	public void setMrName(String mrName) {
		this.mrName = mrName;
	}

	public Integer getMrSize() {
		return this.mrSize;
	}

	public void setMrSize(Integer mrSize) {
		this.mrSize = mrSize;
	}

	public String getUpdateId() {
		return this.updateId;
	}

	public void setUpdateId(String updateId) {
		this.updateId = updateId;
	}

	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	
	public Set<MeetingRoomBooking> getMeetingRoomBookings() {
		return this.meetingRoomBookings;
	}

	public void setMeetingRoomBookings(Set<MeetingRoomBooking> meetingRoomBookings) {
		this.meetingRoomBookings = meetingRoomBookings;
	}

	public MeetingRoomBooking addMeetingRoomBooking(MeetingRoomBooking meetingRoomBooking) {
		getMeetingRoomBookings().add(meetingRoomBooking);
		meetingRoomBooking.setMeetingRoom(this);

		return meetingRoomBooking;
	}

	public MeetingRoomBooking removeMeetingRoomBooking(MeetingRoomBooking meetingRoomBooking) {
		getMeetingRoomBookings().remove(meetingRoomBooking);
		meetingRoomBooking.setMeetingRoom(null);

		return meetingRoomBooking;
	}

}